﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmMasLookUp")]
    public class IcmMasLookUp
    {
        public IcmMasLookUp()
        {
            //Warehouses = new HashSet<Warehouse>();

            //CommitteeFunctions = new HashSet<Committee>();
            //CommitteePositions = new HashSet<Committee>();
            //CommitteeTypes = new HashSet<Committee>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "LookUpId", ResourceType = typeof(Resources.MasLookUpResource))]
        public int LookUpId { get; set; }

        [ForeignKey("MasLookUpType")]
        [DataMember, Display(Name = "LookUpTypeId", ResourceType = typeof(Resources.MasLookUpResource))]
        public int LookUpTypeId { get; set; }

        [DataMember, Display(Name = "LookUpName", ResourceType = typeof(Resources.MasLookUpResource))]
        public string LookUpName { get; set; }

        [DataMember, Display(Name = "Description", ResourceType = typeof(Resources.MasLookUpResource))]
        public string Description { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MasLookUpResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MasLookUpResource))]
        public int CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MasLookUpResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MasLookUpResource))]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MasLookUpResource))]
        public Nullable<DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual IcmMasLookUpType MasLookUpType { get; set; }

        //[DataMember]
        //public virtual ICollection<Warehouse> Warehouses { get; set; }

        //[DataMember]
        //public virtual ICollection<Committee> CommitteeFunctions { get; set; }

        //[DataMember]
        //public virtual ICollection<Committee> CommitteePositions { get; set; }

        //[DataMember]
        //public virtual ICollection<Committee> CommitteeTypes { get; set; }

        public override string ToString()
        {
            return LookUpName;
        }
    }
}
